Method and apparatus for electronic image processing

ABSTRACT

A method and apparatus for electronic image processing are described. One embodiment includes a method of resizing an electronic image that includes image data in two dimensions. The method includes memory-to-memory processing with separable x and y processing. Processing occurs in one or more memory-to-memory passes. On each pass, processing can be one of: low-pass filtering; low-pass filtering and decimation by two; and resampling. Processing is configurable independently in each dimension. Filters are configured on each pass and in each dimension to low-pass filter or obtain gradients for resampling. A multiplexor selects resampling or low-pass filtering on each pass.

TECHNICAL FIELD

Disclosed embodiments of the invention are in the field of processing electronic image data, and more particularly in the field of electronic image resizing.

BACKGROUND

Electronic image data, such as data that creates a television image, must be processed in various ways to make it usable under different circumstances. For example, an image must be resized if it is to be displayed on a smaller screen than the screen for which it was originally formatted. Resizing involves the basic ideas of low-pass filtering, resampling, and decimation. Resampling a signal at a different rate is equivalent to converting a sampled signal to analog using a digital to analog converter (DAC), analog reconstruction filtering, and sampling at a new rate using an ADC, but a much better job can be done entirely in the digital domain.

The resample ratio (output pixels/input pixels) is always from one image to another. Typically, the source image to be resized is broken up into tiles, each of which is processed independently. The output image is re-formed from the tiles in such a way that the resulting picture is acceptable, and ideally no different from an image that had been processed as one large tile. For this precise behavior, the ratios can require as many bits to represent the numerator and denominator as would be needed to represent the largest image widths or heights.

To allow tiling, the top-left pixels of the source and destination images are chosen to be co-sited. A ratio between the images is determined such that one pixel beyond the right-most column of pixels in the source and destination images are also co-sited. The same applies vertically.

For an input sample rate of ƒ_(sample) down-sampled to a lower output sample rate ƒ_(resample), any original sampled frequency components ƒ near (but by definition, less than) the Nyquist limit ƒ_(sample)/2 may cause spectral aliasing. If ƒ_(resample)<ƒ_(sample)  (EQ 1)

and $\begin{matrix} {f > \frac{f_{resample}}{2}} & \left( {{EQ}\mspace{14mu} 2} \right) \end{matrix}$ then spectral aliasing occurs at ƒ _(alias) =ƒ _(sample) −ƒ  (EQ 3)

A polyphase filter system can do these two operations (in the required order) in one filter system, to generate each output sample. However, the polyphase filter approach comes with a high hardware cost, as each filter coefficient set has to form a low-pass filter, and multiple sets of such filter coefficients are required to generate the resampled signal at different output phases. The number of phases used should reflect the target precision of the system, and is usually derived by quantizing results from the ratioing sub-system (which can be implemented exactly using integer arithmetic). Because a polyphase filter will be used only for resizing the majority of the time, the amount of hardware required may not be justified. For example, a two-dimensional (2-D) polyphase filter requires a very large 2-D filter array with a high gate count for good quality frequency response characteristics with acceptable frequency aliasing. The 2-D polyphase filter also requires a large amount of random access memory (RAM) on each filter tap, and a high 2-D read access bandwidth into the polyphase filter. The high bandwidth requires a large amount of register file image storage rather than RAM.

One-dimensional (1-D) polyphase filters can be used for both limited low-pass filtering and resampling in the same pass, but they also require a relatively large number of gates. Another disadvantage is the relative complexity of designing the polyphase coefficients for each application. Even if only used for resizing, the new low-pass filtering characteristics have to be re-calculated for all the resampling phases. This makes dynamic resizing software for the 1-D polyphase filter much slower and less responsive to the user.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of an embodiment of an image resizing engine.

FIG. 2 is a flow diagram of an embodiment of a resizing operation.

DETAILED DESCRIPTION

The present invention overcomes the limitations of the prior art and provides additional benefits. A brief summary of some embodiments and aspects of the invention are first presented. Some simplifications and omissions may be made in the following summary; the summary is intended to highlight and introduce some aspects of the disclosed embodiments, but not to limit the scope of the invention. Thereafter, a detailed description of illustrated embodiments is presented, which will permit one skilled in the relevant art to make and use aspects of the invention. One skilled in the relevant art can obtain a full appreciation of aspects of the invention from the subsequent detailed description, read together with the figures, and from the claims.

One embodiment is a resizing engine that takes a two-dimensional array of image samples from main dynamic random access memory (DRAM), resizes the image independently in x and y, and writes the new image back out to memory. The resizing engine receives image data in a stream of samples from a memory, processes the samples, and writes the processed samples back to the memory. The entire image is processed by the resizing engine in multiple passes until the resizing is achieved. In one pass, all of the samples making up the image are processed once. On each pass through the resizing engine, limited independent resizing operations can be achieved by the hardware in both x and y dimensions. Up-sampling between common formats, and down-sampling by two can be achieved in one pass. More extreme conversions, or down-sampling in general may require more passes.

Each pass can include the same or different processing, depending upon the configuration of various resizing engine components as explained more fully below. For example, in one embodiment, the resizing engine includes one finite impulse response (FIR) filter for processing x-axis data and one FIR for processing y-axis data. Each FIR filter is configured for each pass using predetermined filter coefficients. The FIR filters are configurable to perform various functions, including decimation by an integer factor, low-pass filtering, and generating signal gradients. The resizing engine communicates with memory through a wide data bus, achieving acceptable speed, yet economizing on hardware.

In one embodiment, two fifteen tap FIR filters are used to achieve good spectral performance. One FIR filter is used for each of the x and y axes. The resizing engine throughput performance is adequate for almost any high definition television (HDTV) resizing operations in YUV 4:2:0 in real time. In one embodiment, the gate count is approximately 150,000.

In one embodiment, a main dynamic random access (DRAM) memory is external to the integrated circuit chip of the resizing engine. The main memory may be internal, which may improve performance at the cost of size. An internal main memory interface is split up into banks, one of which is tied directly to the resizing engine for the highest performance. Other internal memory banks can be used with some performance degradation. A controlling processor (external to the resizing engine) is responsible for configuration of the resizing engine by writing data into allocated memory.

FIG. 1 is a block diagram of one embodiment of a resizing engine 100. A main memory read interface 102 receives streamed data from a main memory and stores it in an input double buffer 104. Any hardware design for the resizing engine should take into account the memory access overhead on each memory access burst. In one example embodiment, which will be described with reference to FIG. 1, this overhead is about 11 clocks, so reading or writing a single access burst is not very efficient. The input double buffer 104 alleviates this problem, because each buffer is large enough to allow larger memory access bursts when possible. Larger buffers allow for efficient memory bursts, but typically require more hardware than smaller buffer. Compromises, therefore, are usually made.

In one embodiment, each buffer in the input double buffer 104 is 128 samples wide, allowing input bursts of up to eight 128-bit memory reads at a time. Double buffering allows one buffer to be read while the other is being filled, helping reduce the latency and the impact of main memory access busy stalls. The number of samples actually read depends upon a resampling ratio in x, as 128* src_(—)width/src_(—)height, and is limited to 128 in any case. This precalculated configuration value 103 is stored in memory for each pass (see Table 2, address offset=19).

After a burst read, the next row below it (in image terms) is read as the next burst, and so on until a complete column has been read. The burst reads then starts at the top of the input image to generate the next output column, and so on. Overlap occurs when reading the input columns.

The output of the input double buffer 104 presents 15 samples at a time to the x-axis FIR filter 106, and two of the middle samples also go to the x-axis cubic model generator to give ƒ_(T)(0) and ƒ_(T)(1) (cubic polynomial interpolation is explained more fully below with reference to Equations 4–7).

The x-axis cubic model generator 108 generates the x-axis cubic models. The set of C_(i) are then fed to the x-axis cubic model evaluator 110, which also uses the Δt values from the x ratio system 112 to generate resampled x values.

The resampled x output from the x-axis cubic evaluator 110 and a low-pass filter output go to an x-multiplexor 114 which serves as a switch to select one of the two depending upon the value of the resample_(—)x input 113, which is determined by the resample_(—)x configuration (see Table 2, address offset 20). The low-pass filter output is generated by the x-axis FIR filter 106 when it is configured by the x coefficients 107 to perform low-pass filtering. The output of the x-multiplexor 114 is rounded and clipped to 10 bits by rounding and clipping circuit 116, and fed into an x->y intermediate random access memory (RAM) and shift register 118. The shift-register logic of the RAM and shift register 118 allows 15 new samples to be read from RAM on each clock in the y-axis direction. Each new sample from the x-axis processing is written into the top (15th) sample position of the RAM data. The previous samples are all shifted down by one, and the oldest, or first, sample is discarded from the bottom.

The shift register 118 efficiently provides 15 samples of vertical history. To do this in a pipelined fashion, short line delays (for example, 128 samples) are used. Shorter line delays are more economical, but increase overlapping memory access. The shift register 118 requires a clock for each read and write. In one embodiment interleaved RAM-shift-register systems 118 are used, and each RAM 118 is 64×(15×10) bits (where 64 is the number of lines/sample divided by two, and 10 is number of bits/sample). The item to be written from the shift register 118 back into the RAM 118 is also forwarded to the y-axis FIR filter 120 input. At each new input sample, the next RAM 118 address is processed, until there are no more samples to receive from the previous stage (as may be the case when down-sampling), or until the maximum of 128 samples is reached. This RAM stage is not double buffered, so the timing of the x-axis and y-axis processing has to be synchronized. Two of the center samples presented to the y-axis FIR filter 120 are also extracted as ƒ_(T)(0) and ƒ_(T)(¹). The y-axis FIR filter 120 output is either the differentiating output (signal gradients “g”) or low-pass filter output, depending on how the y coefficients 121 are configured.

The y-axis cubic models use each new gradient, g_(T)(1) (see Equations 4–7), but the y-axis cubic models generated by the y-axis cubic model generator 126 also need the previous gradient, g_(T)(0), for that same column index. A 128-gradient register 122 allows both gradients to be available in a timely manner for the cubic model construction, and then assigns the new gradient to replace the old gradient in the gradient registers, ready for the next time that column is reached.

The y cubic models, along with the Δt produced by the y ratio system 136 are evaluated to obtain the resampled y-axis values. The resampled y-axis values are fed to a y multiplexor 128. The y-multiplexor 128 also receives a y low-pass filter output when the y-axis FIR filter 120 is configured by the y coefficients to perform low-pass filtering. The resample_(—)y input 127 to the multiplexor 128 selects between resampled y-axis data or the y-axis low-pass data.

Unlike the x-axis multiplexor 114 output, the y-axis multiplexor 128 output can be rounded to 8 for efficient storage, or 10 bits for higher quality. The output is then fed to the output double buffer 132. The main memory write interface receives the processed image data from the output double buffer 132 and transmits the processed image data to the main memory. In one embodiment, there is an additional y-axis cubic model evaluator 126 (not shown for simplicity). Two y-axis cubic model evaluators 126 can generate more than one y output sample for every new y-axis cubic model. This makes a significant performance improvement when vertically up-sampling, particularly at ratios near 2:1. These new samples must be absorbed into the output buffer 132 rows, but supporting too many rows becomes expensive in chip area. Most vertical up-sampling ratios are likely to be 4:1 or less, in which case four rows are sufficient.

After the resampled number of columns has been generated, one buffer is ready to be read to memory in a burst, while the other buffer is ready to be written to. In one embodiment, 128 columns is the maximum number that can be generated. The data should be read out along columns instead of rows, so to avoid supporting different read and write organizations. In one embodiment, the processed image data is organized in the main memory as 4 rows×8 columns of addressing, with 16×8 bits of data at each address. The memory address is given by 8*row+column for zero-based indexing. A buffer read of 128 bits (16 samples of 8 bits each, or 8 samples of 16 bits each) can be made on each clock for efficient 9 (or 8 if aligned) clock write bursts to main memory. With 11 clocks of overhead for each horizontal burst write, 1024 bits or 128 samples can be written out to the main memory in 20 clocks. Four such bursts (one for each row) empty a buffer RAM.

Writing to the output double buffer 132 requires byte write enables into the 128-bit output buffer memory because 1 to 4 samples of data (depending upon the y up-sample ratio) are written into a column before moving on to the next column. Each column therefore completes in 1 or 2 clocks. In one embodiment, up to two samples per clock can be generated. The samples cannot be written into different rows of the output buffer RAM in one clock, however, because different rows have different output buffer RAM addresses. In one embodiment, this problem is solved by using a small intermediate register file (for example, a register file of two columns by four rows) to allow accumulation of four clocks worth at two samples per clock. Two write samples per clock can then be transferred into the output buffer RAM using byte enables. This also completes in four clocks (one clock per row). To allow continuous operation, two of these small register files are needed for double buffering within each output buffer. The output from the output double buffer 132 is formatted by the main memory write interface 134 for writing to the main memory in 128-bit bursts where possible.

FIG. 2 is an overview of how image data is processed and stored in an embodiment of a resizing operation using the resizing engine of FIG. 1. The resizing engine components are configured 202 for a pass using data that was previously determined and stored. A software routine controls the resizing engine, including configuring resizing engine components. In one embodiment, the software routine and the configuration data reside remotely from the resizing engine. The configurable components include the FIR filters 106 and 120, the multiplexors 114 and 128, and the ratio systems 112 and 136.

Samples are read 204 into the resizing engine from the external memory, and the samples are processed 206 as previously described (and further described below). The samples are processed according to the configuration of the resizing engine components. Processed samples are written 208 back to the main memory. It is determined 210 whether the sample just processed is the final sample of the image to be processed. If the sample is not the final sample of the image to be processed, a next sample is read 204 and processed 206. If it is the final sample, it is determined 212 whether the pass just completed was the final pass of the resizing operation as dictated by the software routine. If the last pass completed was not the final pass, the resizing engine is configured 202 for the next pass. If the pass just completed was the final pass, the resizing process is finished 214.

The software routine configures the resizing engine appropriately for each pass with certain goals in mind. For example, it is typically desirable to plan passes through the resizing engine such that the image size is reduced as quickly as possible. The filter selection (as configured by coefficients) may be the same for each low-pass filtering operation, or it may be different. A selection of pre-defined filters is available to use on each pass. It is logical to perform decimate-by-two by filtering first if the overall ratio of decimation is down by two or more. The final low-pass filtering pass should perform filtering to match any remaining resampling, which should be on the last pass of the operation. In the case of decimation by two, low-pass filtering and removal of every other sample (½original size) can occur in one pass.

As an example of a resizing operation that can be performed by the resizing engine of FIG. 1, consider decimation by ten as follows:

-   -   Pass1—low-pass filter to ½of bandwidth and decimate by two         (½original size);     -   Pass2—low-pass filter to ½of bandwidth and decimate by two         (¼original size);     -   Pass3—low-pass filter to ½of bandwidth and decimate by two         (⅛original size);     -   Pass4—low-pass filter to nearest 8/10(⅘) of bandwidth (The image         is still ⅛original size); and     -   Pass5— decimate by 5/4or 10/8.

This is 1/10of original size (note that 1/10=⅛× 8/10). The filter is used for gradient calculations in pass 5.

Various details of embodiments of the resizing methods implemented by the resizing filter 100 will now be discussed in more detail.

In one embodiment, a number of low pass filters is used to down-sample by various ratios as low as two, and decimation by larger factors is performed with multiple passes. The number of low-pass filters, as referred to herein, is the number of different configurations of the same filter hardware (x-axis FIR filter 106 or y-axis FIR filter 120) by different sets of x or y coefficients. This does not require that the filters have truly optimal low-pass filter characteristics. Even though some ratios may be slightly overly low-pass filtered (“over-filtered”), this is more desirable than allowing aliasing. The set of low-pass filter characteristics may be logarithmically ratioed to provide uniform worst-case over-filtering.

The various filters defined by the sets of coefficients should be designed to balance the pass-band and stop-band impairments. For example, increased ripple in the pass-band causes in-band picture impairments. Increased ripple in the stop-band allows frequency aliasing. It is also desirable to be able to use symmetric FIR filters because of their predictable delays at all frequencies. In the absence of any known input signal characteristics, satisfactory filters are obtained when so-called equi-ripple FIR filter designs are used. In one embodiment, these are designed using Chebyshev polynomials, for example, optimized using an iterative Remez-exchange algorithm. Different FIR filter designs could be used in other embodiments.

Except for down-sampling by the maximum of two on a pass combined with decimation by two (also referred to herein as decimation by two), low-pass filtering does not change the data rate from input to output along an axis.

In the case of down-sampling by two in a pass, the down-sampling is accomplished by discarding every other sample (decimation by two) immediately after filtering. In the case of down-sampling by two, a single FIR filter is configured to perform both down-sampling and low-pass filtering in one pass. Combining low-pass filtering and down-sampling by two into one pass provides considerable performance benefits. To prevent aliasing in this case, low-pass filtering down to ƒ_(sample)/4 is performed before decimation.

To get good performance for multiple passes of decimation by two, it is desirable to have a low-pass filter that can pass sampled frequencies from zero to ƒ_(sample)/8, so that after decimation the pass-band becomes ƒ_(sample) _(—) _(new)/4. The sample is then ready for filtering in the next pass. If the pass-band further is reduced further, more frequency response errors may be accumulated in the pass-band. If the pass-band is increased, there is a narrower transition band to the stop-band. As a consequence, longer filters would have to be used. Alternatively, more frequency response ripple in the pass-band or stop-band would have to be accepted. Decimation by larger factors is achievable, but the pass-band would be very narrow, and the transition band very steep. Filter performance would therefore be inadequate for most high quality processing.

In one embodiment, a general resampling ratio system is used to control the decimation. With an appropriate low-pass filter design, lower quality decimation by four in one pass is possible, but with lower picture quality for the same filter length.

Resampling is implemented in one embodiment by creating piece-wise polynomial models ƒ_(T)(Δt) at discrete sample times T of the input sample signal, such that each model is a good approximation to the continuous signal over each fractional sample time interval (0≦Δt<1).

One such method of creating piecewise polynomials is to use a cubic polynomial, and fit it to four consecutive samples nearby (e.g. at T={−1,0,1,2}). This approach does not perform well near the Nyquist limit, however, because the equations are ill-conditioned and provide poor model constraints. Also the equations to derive the polynomial coefficients are relatively complex, and thus require more hardware. A better approach is to obtain the gradient g(T) of the sampled signal, co-sited with each sample ƒ(T), and then use the four known values {f(0),g(0),f(1),g(1)} to obtain the cubic coefficients. This approach makes better use of more localized constraint information. If a piece-wise cubic model at time T defines a waveform at any fractional time Δt (known as a Vandermonde system): $\begin{matrix} {{f_{T}\left( {\Delta\; t} \right)} = {\sum\limits_{i = 0}^{3}\;{C_{i}\left( {\Delta\; t} \right)}^{i}}} & \left( {{EQ}\mspace{14mu} 4} \right) \end{matrix}$

-   -   then differentiating with respect to Δt yields: $\begin{matrix}         {{g_{T}\left( {\Delta\; t} \right)} = {\sum\limits_{i = 1}^{3}\;{{iC}_{i}\left( {\Delta\; t} \right)}^{i - 1}}} & \left( {{EQ}\mspace{14mu} 5} \right)         \end{matrix}$

If we evaluate these two equations at times Δt={0, 1}, we obtain: ƒ _(T)(0)=C ₀ ƒ _(t)(1)=C ₃ +C ₂ +C ₁ +C ₀ g _(T)(0)=C ₁ g _(T)(1)=3C ₃+2C ₂ +C ₁  (EQ 6)

These types of equation systems (consisting of Vandermonde matrices and their derivatives) are known to always have a solution, which in this case allows us to find each C_(i) as: C ₀ =ƒ _(T)(0) C ₁ =g _(T)(0) k=ƒ _(T)(1)−ƒ _(t)(0) C ₂=3k−g _(T)(1)−2g _(T)(0)=k−C ₃ −g _(T)(0) C ₃ =g _(T)(1)+g _(T)(0)−2k  (EQ 7)

-   -   using just five add operations.

The set of C_(i) are re-evaluated at every new input sample, and they are linearly proportional to the input. The gradient is linearly proportional to the input, also. From Equation 4, the resampled output is also a nonlinear function of Δt, but as this is purely a function of the reconstructed sample position, and not the input data. The path from sample input to reconstructed sample output is then linear as required.

As discussed earlier, resizing requires low-pass filtering. Using a low-pass FIR filter is a fairly compact solution, compared for example to a polyphase design. Furthermore, low-pass FIR filters with reconstructed delays that are an integer multiple of the sampling period are symmetric, so a 2 n−1 tap filter can be implemented with n multipliers.

If a pass with resampling and low-pass filtering at the same time is never done, the co-sited gradients g_(T) can be obtained using the low-pass FIR filter hardware, but with a new set of coefficients designed for differentiating instead. This is not considering decimation by two, which does not use the resampling system in any case. In one embodiment the filter coefficients are designed for an equi-ripple differentiating response using Remez-exchange techniques. This filter is anti-symmetric; the coefficient magnitudes are symmetric, but with the mirrored coefficients inverted in sign. See Table 1 for a list of differentiating filter coefficients.

In one embodiment, a direct form FIR filter is chosen because block processing is performed on the image data. For symmetric and anti-symmetric filters, the appropriate image samples are added or subtracted, respectively. The results are multiplied by their coefficients, and all the results are added in an equal delay piped adder tree structure. A more conventional transversal FIR filter structure would not be a practical choice because of the clock overhead that comes with filling its pipeline.

In one embodiment, resizing engine hardware is conserved by defining the filter coefficients using an external processor and storing them in a configuration memory. The configuration memory can be any memory external to the resizing engine. Any filter characteristic can be defined as long as it is symmetric or anti-symmetric to take advantage of filter folding to share multipiers. In one embodiment, the filter has a total of 15 or fewer taps. The filter characteristics along the x and y axes are independently definable for each pass. In one embodiment, a set of eight low-pass filters (logarithmically spaced) is defined.

Hardware and algorithm distortions must be balanced in order to obtain an acceptable level of overall performance. Performance considerations for one embodiment that uses the resizing engine of FIG. 1 will now be discussed.

For each axis 1% overall distortion over most of the sampled frequency range is considered acceptable, with a degradation to around 1.5% (6 bits) near a target upper range of 0.8 of the Nyquist limit (ƒ_(sample)/2). Less than 3% distortion is obtained when x and y processing is combined. By comparison, with the same designed frequency response range, practical polyphase designs would struggle to achieve 34% distortion overall for a 5×5, or 22% distortion overall for a 7×7 (49 tap) 2-D design.

If it is assumed that exact gradients can be obtained, the cubic algorithm described above has about a 5% error at the Nyquist limit, reducing rapidly with the fourth power of the sampled frequency to around 2% at a target upper sampled frequency. Gradients above the target do not have to be generated, but there is excessive gain in the cubic algorithm as we near the Nyquist limit. Reducing e gradient values slightly from their correct value actually improves the algorithm performance near the Nyquist limit. A fortuitous property of equi-ripple differentiating filters is that they underestimate the gradient beyond the desired equi-ripple differentiating response region, and about 1.5% distortion at 0.8 of Nyquist is obtainable in an equi-ripple differentiating filter pass-band region designed to end at this point.

A differentiating filter with pass-band equi-ripple of 0.7% from 0.0 to 0.8 of the Nyquist limit needs a 15-tap FIR filter (8 multipliers). The coefficients obtained for one equi-ripple design are as shown in Table 1.

TABLE 1 Differentiating Filter Coefficients (anti-symmetric) for 15-tap FIR Anti-symmetric Coefficient index coefficient index Coefficient value h[0] −h[14] +0.00178016 h[1] −h[13] −0.00561604 h[2] −h[12] +0.01139131 h[3] −h[11] −0.02120364 h[4] −h[10] +0.03763856 h[5] −h[9] −0.06853024 h[6] −h[8] +0.15338417 h[7] 0.0 Note that the coefficients are subsequently scaled up by 2π to normalize the gradient to angular frequency.

In order to match the algorithm performance, the arithmetic should be evaluated at a higher level of precision than the algorithm performance, but not so high as to incur too much hardware. Evaluation to 10-bit two's complement signed should be sufficient, with intermediate input and output formats rounded to 8 bits for maximum performance. A 16-bit intermediate format can be configured for each pass at the cost of higher memory bandwidth (see Table 3). Two's complement number representation is used internally because many values can be negative (e.g., gradients). Unsigned values are translated to a two's complement signed range for first pass input, and translated back again for output on the last pass. The FIR filter should use filter coefficients with two extra bits of precision, and four extra bits of multiplier output precision compared to other processing. The FIR filter should truncate the multiplier outputs for circuit economy. The average direct current (DC) errors introduced by the truncations may be compensated for at the filter output.

Once a set of cubic polynomial coefficients are obtained from Equation 6, then Equation 4 is evaluated using Horner's rule as: ƒ _(T)(Δt)=((C ₃ Δt+C ₂)Δt+C ₁)Δt+C ₀  (EQ 8)

This requires only three multiply operations and three add operations.

In one embodiment, the same 15 tap filter used for low-pass filtering is also used for differentiation. In this case, a transition band of approximately 0.125 ƒ_(sample) is supported, with about 1.3% ripple in the pass-band and stop-band. In particular, this allows a filter that can be configured for decimation by two (pass-band from 0 to 0.125 ƒ_(sample), and stop-band from 0.25 to 0.5 ƒ_(sample)) as was discussed earlier. Other filters can be pre-designed at logarithmically spaced intervals for the lower band-stop edge frequencies (which are used to characterize and select the filter because of the objectionable effects of aliasing). The resulting transition and pass-band responses should be very acceptable visually.

Like any reconstruction system based on sinc interpolation, the filter characteristics outlined above will ring on sharp edges or impulses in the source image. In such cases, the FIR filters can be configured to apply low-pass Gaussian-style filtering in the first pass, at the cost of some throughput performance.

Embodiments of resampling models and generating Δt will now be discussed. If b is the number of output samples to generate for each of a input samples, an embodiment of the resizing engine is designed to achieve at least the following things. The algorithm controls when to progress to a new input sample set and generate a new resampling model. The algorithm derives the Δt values for Equation 8 evaluation within each model. For correct tiling behavior, the algorithm results in the generation of precisely b output samples for every a input samples. The algorithm uses all integer arithmetic for circuit economy and more deterministic behavior. One satisfactory method of approaching this problem is to build a separate time accumulation circuit that indicates when to generate new output samples, and at what fractional time Δt. A separate correction circuit causes the accumulation circuit to correct for any long term accumulation errors given that it is accumulating time as a binary approximation.

The time accumulation circuit accumulates a time step into an n+e bit binary value ratio, which represents time with e most significant bits as the sample time, and n least significant bits as the fractional time Δt. If the sample time is represented by any finite e bits, the time value would eventually overflow. If the actual polynomial model being used is represented as being relative to the e-bit representation within the ratio value, however, the sample time can be decremented every time a new input sample, or model, is processed. If the sample time is zero, the fractional time is used to generate an output value from the cubic model; otherwise no output sample is generated. If the time step is more than a sample time, then at some input sample times the sample time will accumulate to a value greater than or equal to two. In this case, even after the decrement by one per new input sample, no output samples will be generated. Down-sampling per pass is only restricted by the length of the FIR filters, which in practice would do a poor job (e.g., around 11% peak aliasing for unity response at 0 Hz, and an anti-aliasing stop-band at 0.5/8=0.0625 ƒ_(s)) for any factor over about half the number of filter taps. A real limit on e must be set here. At a 250 MHz clock rate, the number of bits representing the accumulated ratio value should be kept as small as possible. The maximum value of the sample time required for a down-sampling of d:1 is d−1. For example, for each input sample possibly arriving at each clock, increment the sample time by time step d, and simultaneously decrement it by 1. If d=8 is allowed, the maximum sample time value is 7, and this can be represented in e=3 bits. The same restriction is placed on both axes. Ten bits should be used to represent the fractional time, as this should match the basic data path precision for a balanced system design. Then 13 bits are required in total.

If, after accumulating the time step into the ratio value, the sample time is still zero, then another output sample is generated at the new fractional time value. Accumulation is repeated until the sample time is greater than zero. This allows several output samples to be generated from one input model.

Ratio is represented as an approximation to the true ratio value, with n bits of fractional time (note that ratio will only be exact if b divides exactly into a*2 ^(n)): $\begin{matrix} {{ratio} = {{floor}\mspace{11mu}\left( \frac{a \times 2^{n}}{b} \right)}} & \left( {{EQ}\mspace{14mu} 9} \right) \end{matrix}$

From the definition of the floor ( ) operator, we know that: $\begin{matrix} {{ratio} \leq \frac{a \times 2^{n}}{b} < {{ratio} + 1}} & \left( {{EQ}\mspace{14mu} 10} \right) \end{matrix}$

A second circuit can now be designed that generates a correction signal with an average value from 0 to less than 1, which is added to the ratio value, such that the average value of the corrected ratio is then exactly correct. The average value of this correction signal can be represented as a rational fraction numerator/denominator, such that: $\begin{matrix} {\frac{a}{b} = \frac{{ratio} + \frac{numerator}{denominator}}{2^{n}}} & \left( {{EQ}\mspace{14mu} 11} \right) \end{matrix}$

From Equation 9 and Equation 11 we find: numerator=(a×2^(n))−(ratio×b)  (EQ 12) denominator=b  (EQ 13)

It can also be shown that: 0≦numerator<denominator  (EQ 14)

-   -   which limits the range of correction as required.

The arithmetic for finding the ratio, numerator and denominator above is only needed for a new a and/or b, and involves division and multiplication. The calculations shown above are performed by an external processor and passed to the resizing engine as part of configuration. The resizing engine resamples independently along each axis, so each requires separate calculations. The values are programmed into the resizing engine configuration for each pass (see Table 2). Note that from Equation 14, the number of bits (say m) representing the numerator and denominator values must be equal, but that the number of bits (n) representing ratio is independent of the others. In practice, the number of bits that represent all these values in hardware is limited. Larger widths or heights may be supportable in certain cases if a and b share prime factors that can be cancelled out, or if numerator and denominator also share prime factors. Shared prime factors can easily be found using Euclid's greatest common divisor (GCD) algorithm. In one embodiment, these optimizations are performed in the external processor.

The resizing engine (for example, the x ratio system 112, and the y ratio system 136 of FIG. 1) makes real-time use of the configured ratio, numerator and denominator values to step through new cubic models, and to generate output samples for the appropriate number of Δt values within each model.

An algorithm for the correction-generating circuit can be expressed in hardware (“pseudo-code”) as:

module correction_(—)generator: input: clock, numerator[m], denominator[m], reset; output: correction; { // two's complement, large enough to hold m-bit denominator register: accumulator[m+1]; wire: correction; wire: delta[m+1]; two's complement value // continuous assignments if (accumulator > = 0) // msb is sign bit for two's complement { correction:= 1; // apply bump correction to circuit 2 // accumulate numerator modulo denominator delta := numerator − denominator; // m-bit result } else { correction := 0; delta:= numerator; } // positive-edge clock triggered register assignments for each posedge clock { if reset accumulator <− (−1); // −1 is two's complement all −1's else accumulator <− (accumulator + delta); } }

Note that the number of bits m allocated to the numerator and denominator must be large enough to represent the ratios required. In our case 12 bits would be sufficient, allowing for all image resizing combinations up to pictures of 4095 in width and height.

An algorithm for the dt and next_(—)model control-signal generation is:

module dt_(—)generator: input: clock, ratio, correction, reset; output: next_(—)model, dt; { register accumulator[n]; // unsigned wire: next_(—)val[n + 1]; // continuous assignments next_(—)val:=accumulator + ratio correction; next_(—)model:=next_(—)val[n]; // overflow bit set => skip to next cubic model // positive edge clock triggered register assignments for each posedge clock { if reset accumulator <− 0; else accumulator <− next_(—)val[n−1) . . . 0]; // discard overflow bit } dt: = accumulator; }

Configuration and control of embodiments of the resizing engine will now be discussed. In one embodiment, a controlling processor external to the resizing engine is responsible for configuration of the resizing engine by writing data into allocated memory and setting the address of the configuration data at the appropriate offset into a vector interrupt table. A vector interrupt table base address is set by a separate register. An offset into the table for the resizing engine is assigned. When the resizing engine signals it is ready, for example by asserting a ready input, the resizing engine reads the address at its offset into the table, de-asserts its ready input, and starts to run. The resizing engine first reads the configuration data pointed to by the vector interrupt table. The first item is an address of the set of data needed to control the next pass. In one embodiment, the item is a linked list. Byte addressing is used.

To make the hardware simpler, all addresses should be aligned to 128-bit (16 byte) memory access boundaries (the bottom four address bits are always zero). All other values within a resizing engine pass configuration are 16-bit aligned (see Table 2). When the current pass is finished, the new linked-list address is the base address for the next pass. If the address is NULL (0), then it is assumed that there are no more passes following the current pass. When the resizing engine has finished, it re-asserts the ready signal. In one embodiment, the only additional interface signals required are signals to communicate with the memory interface and a system clock. All memory access is 128 bits (16 bytes) at a time.

A pixel src_(—)format allows the resizing engine to read and filter through just the samples of interest (for example, just Y in the AYUV format) and ignore the others. While it might be more efficient for the resizing engine to read and resize more than one sample type in a format in the same pass at the same time, this requires considerably more hardware.

The specification of a pixel at the top left of an image is achieved by calculating its 128-bit aligned address externally. The data format must be known in order to tell the resizing engine how to read it. The src_(—)offset of pixels of the selected type (defined by the format) are then calculated within each 128-bit memory access. In one format that is Y samples only, represented by each byte, there are up to 16 Y samples in each memory access, so four bits are required.

TABLE 2 Configuration Contents for Each Pass 16-bit addressing offset Type Description 0 pass_(—)next 30-bit address Address of next past data 2 src_(—)addr 30-bit address Address of top left image pixel to resize 4 dest_(—)addr 30-bit address Address of top left resized output image pixel 6 src_(—)format unsigned 4 bit bits 0–3 source data format (undefined) dest_(—)format unsigned 4 bit bits 4–7 destination data format (undefined) src_(—)offset unsigned 4 bit bits 8–11, source sample offset within access dest_(—)offset unsigned 4 bit bits 12–15, dest. sample offset within access 7 src_(—)width unsigned 12 bit source image width (<=src_(—)stride) 8 src_(—)height unsigned 11 bit source image height 9 src_(—)stride unsigned 10 bit source 128-bit memory stride for down 1 pixel 10 dest_(—)width unsigned 12 bit destination image width (<=dest_(—)stride) 11 dest_(—)height unsigned 11 bit destination image height 12 dest_(—)stride unsigned 12 bit dest. 128-bit memory stride for down 1 pixel 13 horiz_(—)ratio unsigned 10 bit ratio steps through source pixels hori- zontally 14 horiz_(—)num unsigned 12 bit numerator for horizontal ratio correc- tion 15 horiz_(—)denom unsigned 12 bit denominator for horizontal ratio correction 16 vert_(—)ratio unsigned 10 bit ratio steps through destination pixels vertically 17 vert_(—)num unsigned 12 bit numerator for vertical ratio correction 18 vert_(—)denom unsigned 12 bit denominator for vertical ratio correc- tion 19 x_(—)burst_(—)len unsigned 8 bit number of samples to burst-read in x 20 resample_(—)x unsigned 1 bit bit 0, 1 = resample in x, 0 = low-pass filter in x Resample_(—)y unsigned 1 bit bit 1, 1 = resample in y, 0 = low-pass filter in y Unsigned_(—)in unsigned 1 bit bit 2, 1 = unsigned value, 0 = two's complement Unsigned_(—)out unsigned 1 bit bit 3, 1 = unsigned value, 0= two's complement 8_(—)tap_(—)fir_(—)x unsigned 1 bit bit 4, 1 = no x FIR symmetry, 0 = symm/antisymm 8_(—)tap_(—)fir_(—)y unsigned 1 bit bit 5, 1 = no y FIR symmetry, 0 = symm/antisymm 24 x_(—)fir_(—)0 signed 10 bits coefficient 0 for x FIR filter . . . signed 10 bits . . . through other taps to . . . 31 x_(—)fir_(—)7 signed 10 bits coefficient 7 for x FIR filter (center tap) 32 y_(—)fir_(—)0 signed 10 bits coefficient 0 for y FIR filter . . . signed 10 bits . . . through other taps to . . . 39 y_(—)fir_(—)7 signed 10 bits coefficient 7 for y FIR filter (center tap) Note that all values lie in the bottom bits of each memory location unless otherwise stated.

Table 3 describes the different input (source) and output (destination) data formats (eight bits per value unless otherwise noted):

TABLE 3 Data Formats 32-bit Type value Description 0 YYYY I/O 8 bits per sample* 1 UVUV I/O 8 bits per sample 2 AYUV I/O 8 bits per sample 3 YYYYUV I 5 bits per Y sample, 6 bits per U or V, not byte aligned 4 YY I/O 16 bits per sample, the top 10 bits are used* *Format appropriate for intermediate working storage on multiple passes.

Note that a non-byte aligned format cannot be written out, as it needs bits from other sample types to write each byte to memory. The overhead of reading the previous values and combining them back in is probably too high because of the high memory bandwidth.

An external program is responsible for deciding what passes are needed and how to program each pass to achieve the minimum memory bandwidth usage. Once a particular ratio in x and y is selected, the program sets up a list of resizing engine instructions for each pass. For a given image resizing operation, this list of instructions does not change. A pass may either resample, low-pass filter, or low-pass filter and decimate by two. All intermediate storage required for multiple passes is allocated by the external processor. Processing subsequent source images may require changing the source image pointer defined in the first pass instruction block, and the destination pointer defined in the last pass instruction block. All intermediate image storage used between passes can be re-used for each new source image. To save on intermediate memory, all passes relating to a particular sample type should be programmed to occur before handling a different sample type. For example, in a YUV format, complete all passes on Y, then all passes on U, etc.

If the resizing operation is resizing downwards by large factors (e.g. for Picture-In-Picture effects), decimation by two should be used to perform most of the down-sampling in multiple stages. However, down-sampling by two requires an even number of source samples, so down-sampling by S stages requires S factors of two in the source width or height. If this is not the case, a first up-sampling pass may be required to get the smallest possible larger image where this is true.

The processing performed by the resizing engine on each of the x and y axes is completely independent. For example, up-sampling in the x-axis can be accompanied by decimation by two in the y-axis on the same pass. Completely separate decision-making software must therefore be implemented for each of the axes.

If decimation by two is needed, it is desirable to decimate by two as soon as possible to get the amount of data down as quickly as possible for subsequent processing. If up-sampling by factors greater than four is needed vertically, it is desirable to up-sample as late as possible, and to up-sample by factors of four in the last passes, so that higher data rates are postponed as long as possible.

Fractional down-sampling by values between one and two may require two passes. The first pass can use a logarithmically selected pre-designed low-pass filter to reduce any possible aliasing frequency components before resampling. This does not change the data rate. The second pass can then safely resample to a lower rate without aliasing.

The src_(—)stride value is the number of 128-bit memory locations from a sample at image coordinate (x, y) to (x,y+1). For example, if a YYYY format (0) is used, each sample is 8 bits, and 16 samples lie in each 128-bit memory access. If the image is 360 samples in width, there are 22.5 such 16-sample reads. An integer src_(—)stride value greater or equal to this is needed, so 23 is used. To resize the entire source image, src_(—)width would be set to 360, and src_(—)height would be set to the height of the image to be resized. The resizing engine ignores any additional lines in memory.

Resizing from a part of a source image (e.g. zooming) can be accomplished by setting the src_(—)width configuration value to be the width of the image to be zoomed. The value of the src_(—)stride value does not change, as this is based on the full image width. If the part of the image to be zoomed is not at the left edge, then the src_(—)addr value can be changed to point to the top left 128-bit memory location where it lies. The src_(—)offset value can then be set to pick out the sample within that memory location.

Table 4 lists example RAM requirements for one embodiment.

TABLE 4 Total RAM size Instances bits (all instances) Purpose  8x160 2 2,560 Input double buffer 64x150 2 19,200 x −> y intermediate RAM 32x160 2 10,240 Output double buffer 6 32,000 Grand total

Unless the context clearly requires otherwise, throughout the description and the claims, the words “comprise,” “comprising,” and the like are to be construed in an inclusive sense as opposed to an exclusive or exhaustive sense; that is to say, in a sense of “including, but not limited to.” Words using the singular or plural number also include the plural or singular number respectively. Additionally, the words “herein,” “hereunder,” and words of similar import, when used in this application, shall refer to this application as a whole and not to any particular portions of this application.

The above description of illustrated embodiments of the invention is not intended to be exhaustive or to limit the invention to the precise form disclosed. While specific embodiments of, and examples for, the invention are described herein for illustrative purposes, various equivalent modifications are possible within the scope of the invention, as those skilled in the relevant art will recognize. For example, the image resizing describes processes image data in two dimensions, x and y. It is possible to apply the teachings herein to three-dimensional data as well. The teachings of the invention provided herein can be applied to other data processing systems, not only to the method and apparatus described above.

The elements and acts of the various embodiments described above can be combined to provide further embodiments. These and other changes can be made to the invention in light of the above detailed description. In general, the terms used in the following claims should not be construed to limit the invention to the specific embodiments disclosed in the specification, unless the above description explicitly defines such terms. Accordingly, the actual scope of the invention encompasses the disclosed embodiments and all equivalent ways of practicing or implementing the invention under the claims.

While certain aspects of the invention are presented below in certain claim forms, the inventors contemplate the various aspects of the invention in any number of claim forms. For example, while only one aspect of the invention is recited as embodied in a computer-readable medium, other aspects may likewise be embodied in a computer-readable medium. Accordingly, the inventors reserve the right to add additional claims after filing the application to pursue such additional claim forms for other aspects of the invention. 

1. A method for resizing an electronic image, comprising: reading the electronic image from a memory as samples of image data, wherein the samples each include x-axis data and y-axis data; using a first set of predetermined filter coefficients to configure a first filter to perform at least one operation on x-axis data of a plurality of samples, wherein the set of predetermined filter coefficients determine the at least one first operation performed, and wherein the at least first one operation is chosen from a group comprising decimation by a predetermined integer factor, low-pass filtering, and generating signal gradients; receiving an output of the at least one first operation in a second filter; using a second set of predetermined filter coefficients to configure the second filter to perform at least one second operation on y-axis data of the sample; performing the at least one first operation and the at least one second operation on each sample of the electronic image data to produce a set of processed samples; writing the set of processed samples to the memory, reconfiguring the first and the second filter; reading the set of processed samples from the memory; performing the at least one first operation and the at least one second operation on each of the set of processed samples to produce a next set of processed samples; and repeating reading the set of processed samples, reconfiguring, and performing a predetermined number of times to produce a resized version of the electronic image.
 2. The method of claim 1, further comprising: generating an x-axis cubic model using signal gradients output by the first filter; generating an x-axis Δt value using a predetermined resampling ratio, a predetermined numerator, and a predetermined denominator; evaluating the x-axis cubic model and the x-axis Δt value and outputting a resampled x value to a switch; generating a y-axis cubic model using signal gradients output by the second filter; generating a y-axis Δt value using a predetermined resampling ratio, a predetermined numerator, and a predetermined denominator; and evaluating the y-axis cubic model and the y-axis Δt value and outputting a resampled y value to a switch.
 3. The method of claim 2, further comprising: storing a low-pass filter output of the first filter in the switch; storing a low-pass filter output of the second filter in the switch; and configuring the switch to output one of the low-pass filter output of the first filter, the resampled x value, the low-pass filter output of the second filter, and the resampled y value.
 4. The method of claim 1, wherein the at least one first operation and the at least one second operation are the same operation.
 5. The method of claim 1, wherein the first filter and the second filter each receive fifteen samples of image data at one time.
 6. The method of claim 1, wherein the at least one first operation comprises low-pass filtering and decimation by two performed by the first filter at one time.
 7. The method of claim 1, wherein the at least one second operation comprises low-pass filtering and decimation by two performed by the second filter at one time.
 8. The method of claim 1, wherein reading further comprises receiving the samples in a buffer and formatting the samples for the first filter.
 9. The method of claim 1, further comprising: receiving the output of the at least one first operation in a clocked switch; and clocking the clocked switch to transfer the output of the at least one first operation to the second filter so as to coordinate processing of the x-axis data and the y-axis data.
 10. A method of resizing an electronic image, wherein the electronic image includes image data in n dimensions, the method comprising: storing instructions and data for resizing the electronic image in an external memory; executing the instructions in a predetermined order to control the circuit components to resize the electronic image, wherein the data comprises, the at least one set of coefficients, a resampling ratio, a numerator, and a denominator; calculating at least one set of coefficients for each of the n dimensions, wherein each of the at least one set of coefficients configure circuit components to process the image data independently in each of the n dimensions; and processing the image data, wherein processing includes processing all of the image data once in one pass through the circuit during which the circuit has one configuration, and wherein at least one of the circuit components is a filter that is configurable to perform at least one operation during one pass, the at least one operation selected from a group comprising, decimation by an integer factor, low-pass filtering, and generating signal gradients.
 11. The method of claim 10, wherein processing the image data comprises at least one pass, wherein at least one filter processes image data in one of the n dimensions, and wherein each of the at least one filters is independently configured for each pass.
 12. The method of claim 11, further comprising storing output from the at least one filter in a switch such that an output of the switch is selectable based upon an operation performed by the at least one filter.
 13. The method of claim 10, further comprising: receiving the image data from a second memory; formatting the image data into samples; transmitting a set of samples to the filter in regular intervals; and writing processed image data to the second memory so as to overwrite the image data.
 14. The method of claim 10, further comprising generating cubic models using the signal gradients.
 15. The method of claim 14, further comprising: using the resampling ratio, the numerator, and the denominator to generate a Δt value; and using the Δt value to evaluate the cubic models.
 16. An apparatus for resizing an image that includes image data in multiple dimensions, the apparatus comprising: a memory interface coupled to a memory that stores the image data; at least one filter, wherein each of the at least one filters processes data in one each of the multiple dimensions, the at least one filter being configurable to perform at least one of a group of operations during one pass of the image data, the group of operations comprising, decimation by two, low-pass filtering, and generating signal gradients for resampling, wherein the image data is processed in all dimensions in at least one pass and stored as processed image data in the memory; and at least one cubic model generator that receives a signal gradient output for a certain one of the multiple dimensions and generates a cubic model for the certain one of the multiple dimensions.
 17. The apparatus of claim 16, further comprising a ratio system for each of the multiple dimensions, wherein each of the ratio systems receives a predetermined resampling ratio comprising a numerator and a denominator, and generates a Δt value for resampling.
 18. The apparatus of claim 17, further comprising a cubic model evaluator for each of the multiple dimensions that receives the Δt value and the cubic model for one of the multiple dimensions, and generates a resample output for the certain one of the multiple dimensions.
 19. The apparatus of claim 18 further comprising a multiplexor that receives the resample output and a low-pass filter output of the at least one filter, wherein the multiplexor output is configurable based on an operation selected for a current pass.
 20. The apparatus of claim 16, further comprising an input buffer coupled to the memory interface, wherein the input buffer receives image data from the memory and formats the image data into samples for the at least one filter.
 21. The apparatus of claim 16, further comprising an output buffer coupled to the memory interface, wherein the output buffer receives processed image data and formats the processed image data to be stored in the memory.
 22. The apparatus of claim 16, wherein the at least one filter is a fifteen tap finite impulse response (FIR) filter, and wherein each tap receives a sample of the image data.
 23. A system for resizing an image that includes image data in multiple dimensions, the system comprising: a main memory that stores the image data, configuration data, and control data; a memory interface coupled to the main memory that receives the image data, stores the image data, and formats the image data into samples; a resizing engine that performs different operations on the image data on different passes of the image data through the resizing engine, wherein the resizing engine is coupled to the memory interface to read formatted data from the main memory and to output processed image data back to the main memory, the resizing engine comprising a filter for each of the multiple dimensions, wherein the filter processes data in one of the multiple dimensions, the filter being configurable to perform at least one of a group of operations during one pass, the group of operations comprising, decimation by an integer factor, low-pass filtering, and generating signal gradients; and a controlling processor coupled to the resizing engine that executes instructions to control the resizing engine, including instructions for calculating coefficients for configuring the resizing engine to perform different operations on the image data, and instructions for configuring the resizing engine for each pass.
 24. The system of claim 23, wherein the resizing engine further comprises a cubic model generator for each of the multiple dimensions that receives a signal gradient output from the filter and generates a cubic model for one of the multiple dimensions.
 25. The system of claim 24, wherein the resizing engine further comprises a ratio system for each of the multiple dimensions, that receives a predetermined resampling ratio for one of the multiple dimensions, and generates a Δt value for the certain one of the multiple dimensions.
 26. The system of claim 25, wherein the resizing engine further comprises a cubic model evaluator for each of the multiple dimensions that receives a cubic model and a Δt value for one of the mulitple dimensions, and generates a resample output for the dimension.
 27. The system of claim 26, wherein the resizing engine further comprises a multiplexor that receives the resample output and a low-pass output of the at least one filter, wherein a select input of the switch is configurable based on a current configuration of the at least one filter.
 28. The system of claim 23, wherein the controlling processor controls the resizing engine to generate b output samples for each of a input samples, wherein the controlling processor further comprises: a time accumulation circuit that indicates when to begin processing new samples from the memory interface, and when to configure the resizing engine to perform a different operation; a correction circuit that causes the time accumulation circuit to correct for any accumulation errors from binary approximation; and a controlling processor coupled to the resizing engine that executes instructions to control the resizing engine, including instructions for calculating coefficients for configuring the resizing engine to perform different operations on the image data, and instructions for configuring the resizing engine for each pass.
 29. An electromagnetic medium having stored thereon instructions, which when executed in an apparatus, cause the apparatus to resize an electronic image that includes image data in n dimensions, wherein resizing comprises: executing the instructions in a predetermined order to control the circuit components to resize the electronic image, wherein the data comprises, the at least one set of coefficients, a resampling ratio, a numerator, and a denominator; calculating at least one set of coefficients for each of the n dimensions, wherein each of the at least one set of coefficients configure circuit components to process the image data independently in each of the n dimensions; and processing the image data, wherein processing includes processing all of the image data once in one pass through the circuit during which the circuit has one configuration, and wherein at least one of the circuit components is a filter that is configurable to perform at least one operation in all dimensions during one pass, the at least one operation selected from a group comprising, decimation by an integer factor, low-pass filtering, and generating signal gradients.
 30. The electromagnetic medium of claim 29, wherein processing the image data comprises at least one pass, wherein at least one filter processes image data in one of the at least one dimensions, and wherein each of the at least one filters is independently configured for each pass.
 31. The electromagnetic medium of claim 30, wherein resizing further comprises storing output from the at least one filter in a switch such that an output of the switch is selectable based upon an operation performed by the at least one filter.
 32. An apparatus for resizing an electronic image comprised of image data, the apparatus comprising: a main memory read interface coupled to a main memory for receiving the image data; an input buffer coupled to the main memory interface for formatting the image data received from the main memory interface; a finite impulse response (FIR) filter coupled to the input buffer to receive samples of the image date to be processed, wherein the FIR filter performs at least one of a group of operations on the samples of image data in all dimensions on each pass through the image data, the group comprising, low-pass filtering decimation by two, and differentiating to produce signal gradients; a processor coupled to the FIR filter, wherein the processor configures the FIR filter for each pass using predetermined filter coefficients; and a cubic model generator coupled to the FIR filter to receive a signal gradient output.
 33. The apparatus of claim 32, further comprising a cubic model evaluator coupled to the cubic model generator for evaluating a cubic model and generating a resample output.
 34. The apparatus of claim 33, further comprising a ratio system coupled to the cubic model generator for generating a at value using a predetermined resampling ratio, a predetermined numerator, and a predetermined denominator, wherein the cubic model evaluator evaluates a cubic model using the Δt value.
 35. The apparatus of claim 34, further comprising a multiplexor coupled to the cubic model evaluator for receiving the resample output, and coupled to the FIR filter for receiving a low-pass filtering output, wherein an output of the multiplexor is selected based upon a current configuration of the FIR filter. 